﻿#region Copyright (C) Sector7 Software Studio. All rights reserved
/*******************************************************************************************
 * Creation
 *      Author:         Wolf Lai
 *      Date:           2012/4/25 0:26:21
 *      Version:        
 * Modification 
 *      Author: 
 *      Date: 
 *      Description: 
 *      Version:
 *******************************************************************************************/
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Sector7.Restaurant.EntityType;
using Sector7.Framework.Core;
using System.Collections;
using Sector7.Framework.DB;

namespace Sector7.Restaurant.DAO.OleDB
{
    /// <summary>
    /// 销售单明细数据访问接口
    /// </summary>
    public class PurchaseBillItemDAO : IPurchaseBillItemDAO
    {
        #region Public functions
        public int Create(List<RS_PurchaseBillItem> items)
        {
            using (DBHelper opt = new DBHelper())
            {
                string sql =
                    @"INSERT INTO RS_PurchaseBillItem
                            (UnitId
                            ,UnitPrice
                            ,Number
                            ,BillId
                            ,MetadataId)
                        VALUES
                            (@UnitId
                            ,@UnitPrice
                            ,@Number
                            ,@BillId
                            ,@MetadataId)";

                return opt.ExecuteBatchNonQuery(
                    sql,
                    new ArrayList(items),
                    "UnitId",
                    "UnitPrice",
                    "Number",
                    "BillId",
                    "MetadataId");
            }
        }
        #endregion
    }
}
